import {createHashRouter,Navigate} from 'react-router-dom'
import Login from '../pages/login'
import Layout from '../pages/layout'
import Home from '../pages/home'


//routes 生成了整个项目的所有路由 
// 将routes数组拆分成单模块 配置的路由
// 在每个模块的文件夹下 新增当前模块的路由文件 
import {noteRoute} from '../pages/note/router'


// 默认
const routes = [
    {
        path:'/',
        element:<Navigate to="/login" />
    },
    {
        path:'/login',
        element:<Login />
    },
    {
        path:'/home',
        element:<Layout />,
        children:[{
            index:true,
            element:<Home />
        }]
    },
]


const AllRoutes = [...routes,...noteRoute]



const router = createHashRouter(AllRoutes)


export default router;